/*
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-01-29 12:46:04
 * @Description  : 通知相关的类型
 */

import type { PageRes } from './commom'

export interface NoticeReq {
  page?: number
  pageSize?: number
}

// notice返回实体
export interface NoticeRes {
  id: string
  name: string
  content: string
  type: number
  sendTime: string
  isActive: number
  level: number
  createTime: string
  auth: string
}

// 分页notice返回实体
export type NoticePageRes = PageRes<NoticeRes>

// 通知授权对象实体
export interface NoticeAuth {
  all: number
  depIds: string[]
  userIds: string[]
  roleIds: string[]
}

// 通知添加请求实体类型
export interface NoticeCreateReq {
  name: string
  content: string
  type: number
  sendTime: string
  isActive: number
  level: number
  auth: NoticeAuth
}

// 通知修改请求实体
export interface NoticeUpdateReq extends NoticeCreateReq {
  noticeId?: string
}

// =============================== 通知管理页面渲染所需要类型============================================
export type NoticeRowData = NoticeRes
